Page({
    data: {
        _num: 3,
        page: 2,
        page_loading: !0,
        status: 0,
        list: []
    },
    onLoad: function(t) {},
    getList: function(t) {
        var a = this;
        wx.showLoading({
            content: "加载中",
        }), getApp().request({
            url: getApp().api.admin.comment.list,
            data: {
                score: this.data._num,
                is_reply: this.data.status,
                page: t
            },
            method: "get",
            success: function (t) {
              wx.hideLoading()
              if (0 == t.code) {
                var e = t.data.list, i = !1;
                20 == e.length && (i = !0), a.setData({
                  list: e,
                  more_list: i,
                  page: 2
                });
              } else wx.showToast({
                title: t.msg,
                icon: 'none'
              });
            },
            fail: function(t) {
              wx.showToast({
                title: t.msg,
                icon: 'none'
              })
            }
        });
    },
    getMore: function(t) {
        var a = this;
      wx.showLoading({
        content: "加载中",
      }), getApp().request({
          url: getApp().api.admin.comment.list,
            data: {
                score: this.data._num,
                is_reply: this.data.status,
                page: t
            },
            method: "get",
          success: function (t) {
            wx.hideLoading()
            if (0 == t.code) {
              var i = a.data.list, n = t.data.list, o = !1;
              20 == n.length && (o = !0), i = i.concat(n), t++ , a.setData({
                list: i,
                page: t,
                more_list: o
              });
            } else wx.showToast({
              title: t.data.msg,
              icon: 'none'
            });
          },
          fail: function (t) {
            wx.showToast({
              title: t.data.msg,
              icon: 'none'
            })
          }
        });
    },
    tab: function(t) {
        var a = t.currentTarget.dataset.num;
        this.setData({
            _num: a,
            list: [],
            status: 0,
            keyword: ""
        }), this.getList(1);
    },
    tabStatus: function(t) {
        var a = t.currentTarget.dataset.status;
        this.setData({
            status: a,
            list: [],
            keyword: ""
        }), this.getList(1);
    },
    show: function(t) {
        var a = this, e = t.currentTarget.dataset.id, i = t.currentTarget.dataset.show;
        wx.showLoading({
            content: "加载中"
        }), getApp().request({
            url: getApp().api.admin.comment.hide,
            data: {
                id: e,
                is_hide: i
            },
            method: "post",
            success: function (t) {
              wx.hideLoading(), 0 == t.code ? a.getList(1) : wx.showToast({
                title: t.msg,
                icon: 'none'
              });
            },
            fail: function() {
              wx.showToast({
                title: t.msg,
                icon: 'none'
              });
            }
        });
    },
    onReady: function(t) {
        this.setData({
            page_loading: !1
        });
    },
    onShow: function() {
        this.getList(1);
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.more_list && this.getMore(this.data.page);
    },
    onShareAppMessage: function() {}
});